const sqlite3 = require("sqlite3").verbose();

const db = new sqlite3.Database("database-html-list.db", (err) => {
  if (err) {
    console.error("--------------------connectDatabaseErr" + err.message);
  }
  console.log("👉👉👉-----------------数据库连接成功");
});

db.serialize(() => {
  db.run(
    "CREATE TABLE IF NOT EXISTS item_list (id INTEGER PRIMARY KEY, name TEXT, json_data TEXT)"
  );
  console.log("Table created successfully.");
});

module.exports = db;
